home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / ExtUtils::Liblist.z / ExtUtils::Liblist
Encoding:
Text File  |  2002-10-03  |  12.0 KB  |  331 lines

  1.  
  2.  
  3.  
  4. EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))                                      EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ExtUtils::Liblist - determine libraries to use and how to use them
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      require ExtUtils::Liblist;
  13.  
  14.      ExtUtils::Liblist::ext($self, $potential_libs, $verbose);
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      This utility takes a list of libraries in the form -llib1 -llib2 -llib3
  18.      and prints out lines suitable for inclusion in an extension Makefile.
  19.      Extra library paths may be included with the form -L/another/path this
  20.      will affect the searches for all subsequent libraries.
  21.  
  22.      It returns an array of four scalar values: EXTRALIBS, BSLOADLIBS,
  23.      LDLOADLIBS, and LD_RUN_PATH.  Some of these don't mean anything on VMS
  24.      and Win32.  See the details about those platform specifics below.
  25.  
  26.      Dependent libraries can be linked in one of three ways:
  27.  
  28.      +o For static extensions
  29.        by the ld command when the perl binary is linked with the extension
  30.        library. See EXTRALIBS below.
  31.  
  32.      +o For dynamic extensions
  33.        by the ld command when the shared object is built/linked. See
  34.        LDLOADLIBS below.
  35.  
  36.      +o For dynamic extensions
  37.        by the DynaLoader when the shared object is loaded. See BSLOADLIBS
  38.        below.
  39.  
  40.      EEEEXXXXTTTTRRRRAAAALLLLIIIIBBBBSSSS
  41.  
  42.      List of libraries that need to be linked with when linking a perl binary
  43.      which includes this extension Only those libraries that actually exist
  44.      are included.  These are written to a file and used when linking perl.
  45.  
  46.      LLLLDDDDLLLLOOOOAAAADDDDLLLLIIIIBBBBSSSS aaaannnndddd LLLLDDDD____RRRRUUUUNNNN____PPPPAAAATTTTHHHH
  47.  
  48.      List of those libraries which can or must be linked into the shared
  49.      library when created using ld. These may be static or dynamic libraries.
  50.      LD_RUN_PATH is a colon separated list of the directories in LDLOADLIBS.
  51.      It is passed as an environment variable to the process that links the
  52.      shared library.
  53.  
  54.      BBBBSSSSLLLLOOOOAAAADDDDLLLLIIIIBBBBSSSS
  55.  
  56.      List of those libraries that are needed but can be linked in dynamically
  57.      at run time on this platform.  SunOS/Solaris does not need this because
  58.      ld records the information (from LDLOADLIBS) into the object file.  This
  59.      list is used to create a .bs (bootstrap) file.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))                                      EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))
  71.  
  72.  
  73.  
  74. PPPPOOOORRRRTTTTAAAABBBBIIIILLLLIIIITTTTYYYY
  75.      This module deals with a lot of system dependencies and has quite a few
  76.      architecture specific iiiiffffs in the code.
  77.  
  78.      VVVVMMMMSSSS iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnn
  79.  
  80.      The version of _e_x_t() which is executed under VMS differs from the Unix-
  81.      OS/2 version in several respects:
  82.  
  83.      +o Input library and path specifications are accepted with or without the
  84.        -l and -L prefices used by Unix linkers.  If neither prefix is present,
  85.        a token is considered a directory to search if it is in fact a
  86.        directory, and a library to search for otherwise.  Authors who wish
  87.        their extensions to be portable to Unix or OS/2 should use the Unix
  88.        prefixes, since the Unix-OS/2 version of _e_x_t() requires them.
  89.  
  90.      +o Wherever possible, shareable images are preferred to object libraries,
  91.        and object libraries to plain object files.  In accordance with VMS
  92.        naming conventions, _e_x_t() looks for files named _l_i_bshr and _l_i_brtl; it
  93.        also looks for _l_i_blib and lib_l_i_b to accomodate Unix conventions used in
  94.        some ported software.
  95.  
  96.      +o For each library that is found, an appropriate directive for a linker
  97.        options file is generated.  The return values are space-separated
  98.        strings of these directives, rather than elements used on the linker
  99.        command line.
  100.  
  101.      +o LDLOADLIBS and EXTRALIBS are always identical under VMS, and BSLOADLIBS
  102.        and LD_RIN_PATH are always empty.
  103.  
  104.      In addition, an attempt is made to recognize several common Unix library
  105.      names, and filter them out or convert them to their VMS equivalents, as
  106.      appropriate.
  107.  
  108.      In general, the VMS version of _e_x_t() should properly handle input from
  109.      extensions originally designed for a Unix or VMS environment.  If you
  110.      encounter problems, or discover cases where the search could be improved,
  111.      please let us know.
  112.  
  113.      WWWWiiiinnnn33332222 iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnn
  114.  
  115.      The version of _e_x_t() which is executed under Win32 differs from the
  116.      Unix-OS/2 version in several respects:
  117.  
  118.      +o If $potential_libs is empty, the return value will be empty.
  119.        Otherwise, the libraries specified by $Config{libs} (see Config.pm)
  120.        will be appended to the list of $potential_libs.  The libraries will be
  121.        searched for in the directories specified in $potential_libs as well as
  122.        in $Config{libpth}. For each library that is found,  a space-separated
  123.        list of fully qualified library pathnames is generated.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))                                      EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))
  137.  
  138.  
  139.  
  140.      +o Input library and path specifications are accepted with or without the
  141.        -l and -L prefices used by Unix linkers.
  142.  
  143.        An entry of the form -La:\foo specifies the a:\foo directory to look
  144.        for the libraries that follow.
  145.  
  146.        An entry of the form -lfoo specifies the library foo, which may be
  147.        spelled differently depending on what kind of compiler you are using.
  148.        If you are using GCC, it gets translated to libfoo.a, but for other
  149.        win32 compilers, it becomes foo.lib.  If no files are found by those
  150.        translated names, one more attempt is made to find them using either
  151.        foo.a or libfoo.lib, depending on whether GCC or some other win32
  152.        compiler is being used, respectively.
  153.  
  154.        If neither the -L or -l prefix is present in an entry, the entry is
  155.        considered a directory to search if it is in fact a directory, and a
  156.        library to search for otherwise.  The $Config{lib_ext} suffix will be
  157.        appended to any entries that are not directories and don't already have
  158.        the suffix.
  159.  
  160.        Note that the -L and -l prefixes are nnnnooootttt rrrreeeeqqqquuuuiiiirrrreeeedddd, but authors who wish
  161.        their extensions to be portable to Unix or OS/2 should use the
  162.        prefixes, since the Unix-OS/2 version of _e_x_t() requires them.
  163.  
  164.      +o Entries cannot be plain object files, as many Win32 compilers will not
  165.        handle object files in the place of libraries.
  166.  
  167.      +o Entries in $potential_libs beginning with a colon and followed by
  168.        alphanumeric characters are treated as flags.  Unknown flags will be
  169.        ignored.
  170.  
  171.        An entry that matches /:nodefault/i disables the appending of default
  172.        libraries found in $Config{libs} (this should be only needed very
  173.        rarely).
  174.  
  175.        An entry that matches /:nosearch/i disables all searching for the
  176.        libraries specified after it.  Translation of -Lfoo and -lfoo still
  177.        happens as appropriate (depending on compiler being used, as reflected
  178.        by $Config{cc}), but the entries are not verified to be valid files or
  179.        directories.
  180.  
  181.        An entry that matches /:search/i reenables searching for the libraries
  182.        specified after it.  You can put it at the end to enable searching for
  183.        default libraries specified by $Config{libs}.
  184.  
  185.      +o The libraries specified may be a mixture of static libraries and import
  186.        libraries (to link with DLLs).  Since both kinds are used pretty
  187.        transparently on the win32 platform, we do not attempt to distinguish
  188.        between them.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))                                      EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))
  203.  
  204.  
  205.  
  206.      +o LDLOADLIBS and EXTRALIBS are always identical under Win32, and
  207.        BSLOADLIBS and LD_RUN_PATH are always empty (this may change in
  208.        future).
  209.  
  210.      +o You must make sure that any paths and path components are properly
  211.        surrounded with double-quotes if they contain spaces. For example,
  212.        $potential_libs could be (literally):
  213.  
  214.                "-Lc:\Program Files\vc\lib" msvcrt.lib "la test\foo bar.lib"
  215.  
  216.        Note how the first and last entries are protected by quotes in order to
  217.        protect the spaces.
  218.  
  219.      +o Since this module is most often used only indirectly from extension
  220.        Makefile.PL files, here is an example Makefile.PL entry to add a
  221.        library to the build process for an extension:
  222.  
  223.                LIBS => ['-lgl']
  224.  
  225.        When using GCC, that entry specifies that MakeMaker should first look
  226.        for libgl.a (followed by gl.a) in all the locations specified by
  227.        $Config{libpth}.
  228.  
  229.        When using a compiler other than GCC, the above entry will search for
  230.        gl.lib (followed by libgl.lib).
  231.  
  232.        If the library happens to be in a location not in $Config{libpth}, you
  233.        need:
  234.  
  235.                LIBS => ['-Lc:\gllibs -lgl']
  236.  
  237.        Here is a less often used example:
  238.  
  239.                LIBS => ['-lgl', ':nosearch -Ld:\mesalibs -lmesa -luser32']
  240.  
  241.        This specifies a search for library gl as before.  If that search fails
  242.        to find the library, it looks at the next item in the list. The
  243.        :nosearch flag will prevent searching for the libraries that follow, so
  244.        it simply returns the value as -Ld:\mesalibs -lmesa -luser32, since GCC
  245.        can use that value as is with its linker.
  246.  
  247.        When using the Visual C compiler, the second item is returned as
  248.        -libpath:d:\mesalibs mesa.lib user32.lib.
  249.  
  250.        When using the Borland compiler, the second item is returned as
  251.        -Ld:\mesalibs mesa.lib user32.lib, and MakeMaker takes care of moving
  252.        the -Ld:\mesalibs to the correct place in the linker command line.
  253.  
  254. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  255.      the _E_x_t_U_t_i_l_s::_M_a_k_e_M_a_k_e_r manpage
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))                                      EEEExxxxttttUUUUttttiiiillllssss::::::::LLLLiiiibbbblllliiiisssstttt((((3333))))
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                                                         PPPPaaaaggggeeee 5555
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.